#include <sstream>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include "Time.h"

using namespace boost::posix_time;
using namespace boost::gregorian;
using namespace kc_sf;

// ----------------------------------------------------------------- //

std::string TimeToString::operator()( const boost::posix_time::ptime &_time ) const
{
	time_facet *facet = new time_facet("%Y-%m-%d %H:%M:%S");
	std::stringstream date_stream;
	date_stream.imbue( std::locale( date_stream.getloc(), facet ) );
	date_stream << _time;

	return date_stream.str();
}

